<template>
   <el-row>
        <el-col :span="24">
            <el-table :data="prescriptionList" >
                <el-table-column label="药品名称" prop="drugInfo.drugName"></el-table-column>
                <el-table-column label="药品规格" prop="drugInfo.drugFormat" />
                <el-table-column label="用法用量" prop="drugUsage"></el-table-column>
                <el-table-column label="数量" prop="drugNumber"/>
                <el-table-column label="药品价格" prop="drugInfo.drugPrice" />
                <el-table-column label="开立时间" prop="creationTime" />
                <el-table-column label="状态" prop="drugState" />
                <template #default="{row}">
                    <el-button
                        size="small"
                        type="danger"
                        :disabled="row.drugState!='已缴费'"
                        @click="sendDrug(row)"
                    >
                        发药
                    </el-button>
                </template>
            </el-table>
        </el-col>
    </el-row>
</template>

<script setup>
import httpRequest from '@/common';
import { ElMessage } from 'element-plus';
import {ref,getCurrentInstance, onMounted,defineProps, watch, computed} from 'vue';

const {proxy} = getCurrentInstance();

const prescriptionList = ref([])

const query = ref({
    registerId: null
})

const getPrescription = ()=>{
    httpRequest(
            proxy,
            'post',
            '/prescription/conditions',
            query.value,
            resultBean=>{
                prescriptionList.value = resultBean.data;
            }
        )

}

onMounted(()=>{
    getPrescription();
})

</script>

<style>
</style>